<p>
{foreach from=$games key=myId item=i name=gameT}
	{if $smarty.foreach.gameT.first}
		<table>
			{if !isset($game_id)}
				<caption>Tahmin Listesi ({$i->username})</caption>
				<tr>
					<th>Tarih</th><th>Ev Sahibi</th><th>Skor</th><th>Konuk</th><th>Pts</th><th>Linkler</th>
				</tr>
			{else}
				<caption>{$i->home_team} - {$i->away_team}</caption>
				<tr>
					<th>Tarih</th><th>Tahminci</th><th>Skor</th><th>Pts</th><th>Linkler</th>
				</tr>
			{/if}
	{/if}
	<tr>
		{if !isset($game_id)}
			<td>{$i->game_date|date_format:"%d/%m/%Y"}</td>
			<td>{$i->home_team}</td>
			<td>{$i->home_score} - {$i->away_score}</td>
			<td>{$i->away_team}</td>
			<td>{$i->pts}</td>
		{else}
			<td>{$i->game_date|date_format:"%d/%m/%Y"}</td>
			<td>{$i->username}</td>
			<td>{$i->home_score} - {$i->away_score}</td>
			<td>{$i->pts}</td>
		{/if}
		<td>
			{if $my_session->isAdmin()}
				|<a href="games.php?action=reCalc&id={$i->game_id}&username={$i->username}">Hesapla</a>
			{/if}
		    {if !isset($game_id)}
				|<a href="games.php?action=userPredictions&game_id={$i->game_id}">Tahminler</a>
			{else}
				|<a href="games.php?action=userPredictions&userName={$i->username}">Tahminler</a>
			{/if}
		</td>		
	</tr>
	{if $smarty.foreach.gameT.last}
		</table>
	{/if}
{/foreach}
</p>